#ifndef ENGINE_SCENE_H
#define ENGINE_SCENE_H

#include <string>
#include <memory>

namespace GameEngine {

class SceneManager; // Forward declaration

class Scene {
public:
    Scene(const std::string& name) : m_name(name), m_isInitialized(false), m_isActive(false) {}
    virtual ~Scene() = default;

    // Called once when the scene is first created or loaded.
    virtual void OnCreate() = 0;

    // Called once when the scene is about to be destroyed or unloaded.
    virtual void OnDestroy() = 0;

    // Called when the scene becomes the active scene.
    virtual void OnActivate() = 0;

    // Called when the scene is no longer the active scene.
    virtual void OnDeactivate() = 0;

    // Called every frame to update scene logic.
    virtual void Update(float deltaTime) = 0;

    // Called every frame to render the scene.
    virtual void Render() = 0;

    const std::string& GetName() const { return m_name; }
    bool IsInitialized() const { return m_isInitialized; }
    bool IsActive() const { return m_isActive; }

protected:
    friend class SceneManager; // Allow SceneManager to manage internal state like m_isInitialized, m_isActive

    std::string m_name;
    bool m_isInitialized;
    bool m_isActive;
    SceneManager* m_sceneManager = nullptr;
};

}

#endif
